package com.lai.note.util;

import java.io.InputStream;
import java.util.Properties;

/**
 * Author: Huang jw
 * Mail:1182175529@qq.com
 * Date:2018/10/17.
 * Time:16:57.
 */
public class PropertyUtil {
    private Properties properties;

    public PropertyUtil(String path) {
        this.properties = new Properties();
        try {
            InputStream in = com.lai.note.util.PropertyUtil.class.getClassLoader().getResourceAsStream(path);
            properties.load(in);
        } catch (Exception e) {
            throw new RuntimeException("文件不存在");
        }
    }

    public String getProperty(String key){
        return properties.getProperty(key);
    }
}
